/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;
import POJO.Mathang;
import POJO.Danhmuc;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import util.HibernateUtil;
/**
 *
 * @author NhuBinh
 */
public class MatHangDAO {
    public static Mathang layThongTinMatHang(String maMatHang) {
        Mathang mh = null;
        Session session = HibernateUtil.getSessionFactory().openSession(); 
        try { 
            mh = (Mathang) session.get(Mathang.class, maMatHang); 
            
            System.out.println(mh.getMaDanhMuc()); 
            
        } catch (HibernateException ex) { 
            //Log the exception 
            System.err.println(ex); 
        } finally { 
            session.close(); 
        } 
        return mh;
    
    }
}
